package com.cat.greedyAlgorithm;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/minimum-suffix-flips/description/
 * @create 2025/8/25 10:23
 * @since JDK17
 */

public class Solution30 {
    public int minFlips(String target) {
        int n = target.length(), ans = 0;
        for (int i = 0; i < n; i++) {
            if (ans % 2 != target.charAt(i) - '0') {
                ans++;
            }
        }

        return ans;
    }
}
